<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%
	response.setHeader("Pragma", "No-cache");
	response.setHeader("Cache-Control", "no-cache");
	response.setDateHeader("Expires", 0);
%>
<!-- 版本3.0 -->
<!DOCTYPE html>
<html>
	<head lang="en">
	    <meta charset="UTF-8">
	    <title>日志列表</title>
		<jsp:include page="../common/top.jsp"></jsp:include>
		<style type="text/css">
			#_table td img{
				max-height: 20px;
			}
		</style>
  	</head>
	<body class="page-content">
		<div class="page-content-area" data-ajax-content="true">
			<div class="page-header">
				<h1>日志列表</h1>
			</div>
			<div class="row">
				<div class="col-xs-12">
					<div class="widget-box">
						<div class="widget-header widget-header-small">
							<h5 class="widget-title lighter">搜索栏</h5>
						</div>
	
						<div class="widget-body">
							<div class="widget-main">
								<form id="_form" class="form-inline">

								</form>
							</div>
						</div>
					</div>
					<div class="row">
						<div class="col-xs-12">
							<div>
								<div class="dataTables_wrapper form-inline no-footer">
									<table id="_table" class="table table-striped table-bordered table-hover dataTable no-footer"></table>
 								</div>
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>
		<jsp:include page="../common/bottom.jsp"></jsp:include>
		<script type="text/javascript">
		jQuery(function($) {
			// 列表
    		var $table = $("#_table").table({
    			url : "list",
    			formId: "_form",
    			tools : [
							{text : '清空全部日志',  clazz : 'blue', icon : 'fa fa-pencil', permission : '/admin/student/edit', handler : function(){
									$.ajax({
										url:"${path}/admin/sysLog/del",
										data:{"ids":$table.getSelectedItemKeys("id")},
										async : false,
										type:"post",
										dataType:"json",
										success:function(result){
											if (result.status == '0000') {
												alert("已清空完毕");
												location.href = "";
											} else  {
												$.gritter.add(result.message);
											}
										}
									});
								}
							}
							
						],
						columns : [
							        {field:'id', hide : true},
							        {field:'logContent', title:'日志内容', align:'left'},
							        {field:'operateIp', title:'创建人ip', align:'left'},
							        {field:'paramName', title:'参数名称', align:'left'},
							        {field:'paramValue', title:'参数的值', align:'left'},
							        {field:'createBy', title:'创建人', align:'left'},
							        {field:'createDate', title:'修改时间', align:'left'}
								],
				
				after : function(){
					// 权限处理
					$.permission();
				}
			});
			
    		//搜索
			$(".search-data").keyup(function () { 
				$table.search();
			});
            
		});
		</script>
	</body>
</html>